/*
     Copyright 2012 Edouard Griffiths <f4exb at free dot fr>
 
     This file is part of WSGC. A Weak Signal transmission mode using Gold Codes
 
     This program is free software; you can redistribute it and/or modify
     it under the terms of the GNU General Public License as published by
     the Free Software Foundation; either version 2 of the License, or
     (at your option) any later version.
 
     This program is distributed in the hope that it will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
 
     You should have received a copy of the GNU General Public License
     along with this program; if not, write to the Free Software
     Foundation, Inc., 51 Franklin Street, Boston, MA  02110-1301  USA

     Static not real time prototype in C++
      
     Autocorrelation record

     Stores one autocorrelation round data
*/
#ifndef __AUTOCORRELATION_RECORD_H__
#define __AUTOCORRELATION_RECORD_H__

#include "WsgcTypes.h"
#include <sstream>

class AutocorrelationRecord
{
public:
	AutocorrelationRecord();
	~AutocorrelationRecord();

	void reset();
	void dump(unsigned int magnitude_factor, std::ostringstream& os) const;
	void dump_line(wsgc_float magnitude_factor, std::ostringstream& os) const;
	static void dump_banner(std::ostringstream& os);

	// Ni, prn_index_max, value_max, bin_index_max, phase_max, fd, frequency_locked
	unsigned int global_prn_index;     //!< PRN index in the global sequence of received PRNs
	unsigned int prn_per_symbol_index; //!< PRN index in the arbitrary PRN per symbol cycle
	wsgc_float magnitude;              //!< Magnitude of autocorrelation
	wsgc_float magnitude_avg;          //!< Average of autocorrelation magnitudes over averaging window
	wsgc_complex acorr;                //!< Autocorrelation complex value
};

#endif // __AUTOCORRELATION_RECORD_H__
